package com.api.wall.getevent;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.test.context.ContextConfiguration;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import com.api.test.AbstractApiTest;
import com.zyncro.api.IWallApiService;
import com.zyncro.api.exceptions.ZyncroApiException;
import com.zyncro.api.model.EventApi;
import com.zyncro.api.model.ObjectResultApi;

@ContextConfiguration(locations = "classpath:/wall/wall-static.xml")
public class GetEvent extends AbstractApiTest {

	@Value("#{group_toGetComments[participant].appId}")
	private String userUrn;

	@Value("#{group_toGetComments[participant].password}")
	private String userPassword;

	@Value("#{group_toGetComments.eventUrn}")
	private String eventUrn;

	@BeforeClass
	protected void setParameters() throws Exception {

		getApi().login(userUrn, userPassword);
	}

	@Test
	public void testGetEvent() throws ZyncroApiException {

		boolean includeHtml = false;
		boolean includeProperties = false;

		ObjectResultApi<EventApi> result = getApi().getService(IWallApiService.class).getEvent(eventUrn, includeHtml, includeProperties);

		Assert.assertNotNull(result);

	}
}
